//
//  PTRecorderEvaluationReportController.m
//  PocketTutor
//
//  Created by yate1996 on 15/6/12.
//  Copyright (c) 2015年 yate1996. All rights reserved.
//

#import "PTRecorderEvaluationReportController.h"

@interface PTRecorderEvaluationReportController ()

@end

@implementation PTRecorderEvaluationReportController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.title = @"Read My Evaluation";
    [self setupLevelView];
    self.currentLevel = 2;
    [self setupCurrentLevelView:self.currentLevel];

}

-(void)setupCurrentLevelView:(NSInteger)currentLevel
{
    switch (currentLevel) {
        case 1:
            self.currentLevelImage = [UIImage imageNamed:@"Oval_level1_red"];
            self.advancedView.backgroundColor = [UIColor colorWithPatternImage:self.currentLevelImage];
            self.currentLevelLabel.center = (CGPoint){self.level1Label.centerX,self.level1Label.centerY - 6};
            self.level1Label.centerY += 6;
            self.level1Label.textColor = [UIColor redColor];
            self.level1Label.font = [UIFont systemFontOfSize:12];
            break;
        case 2:
            self.currentLevelImage = [UIImage imageNamed:@"Oval_level2_red"];
            self.intermediateHighView.backgroundColor = [UIColor colorWithPatternImage:self.currentLevelImage];
            self.currentLevelLabel.center = (CGPoint){self.level2Label.centerX,self.level2Label.centerY - 6};
            self.level2Label.centerY += 6;
            self.level2Label.textColor = [UIColor redColor];
            self.level2Label.font = [UIFont systemFontOfSize:12];

            break;
        case 3:
            self.currentLevelImage = [UIImage imageNamed:@"Oval_level3_red"];
            self.intermediateView.backgroundColor = [UIColor colorWithPatternImage:self.currentLevelImage];
            self.currentLevelLabel.center = (CGPoint){self.level3Label.centerX,self.level3Label.centerY - 6};
            self.level3Label.centerY += 6;
            self.level3Label.textColor = [UIColor redColor];
            self.level3Label.font = [UIFont systemFontOfSize:12];

            break;
        case 4:
            self.currentLevelImage = [UIImage imageNamed:@"Oval_level4_red"];
            self.elementaryView.backgroundColor = [UIColor colorWithPatternImage:self.currentLevelImage];
            self.currentLevelLabel.center = (CGPoint){self.level4Label.centerX,self.level4Label.centerY - 6};
            self.level4Label.centerY += 6;
            self.level4Label.textColor = [UIColor redColor];
            self.level4Label.font = [UIFont systemFontOfSize:12];

            break;
        case 5:
            self.currentLevelImage = [UIImage imageNamed:@"Oval_level5_red"];
            self.beginningView.backgroundColor = [UIColor colorWithPatternImage:self.currentLevelImage];
            self.currentLevelLabel.center = (CGPoint){self.level5Label.centerX,self.level5Label.centerY - 6};
            self.level5Label.centerY += 6;
            self.level5Label.textColor = [UIColor redColor];
            self.level5Label.font = [UIFont systemFontOfSize:12];

            break;
        default:
            break;
    }
}

-(void)setupLevelView
{
    UIImage *image = [UIImage imageNamed:@"Oval_level1"];
    self.advancedView.frame = (CGRect){{0,0},image.size};
    self.advancedView.center = (CGPoint){160,140};
    self.advancedView.backgroundColor = [UIColor colorWithPatternImage:image];
    
    image = [[UIImage imageNamed:@"Oval_level2"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.intermediateHighView.frame = (CGRect){{0,0},image.size};
    self.intermediateHighView.center = (CGPoint){160,140};
    self.intermediateHighView.backgroundColor = [UIColor colorWithPatternImage:image];
    
    image = [[UIImage imageNamed:@"Oval_level3"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.intermediateView.frame = (CGRect){{0,0},image.size};
    self.intermediateView.center = (CGPoint){160,140};
    self.intermediateView.backgroundColor = [UIColor colorWithPatternImage:image];
    image = [[UIImage imageNamed:@"Oval_level4"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    self.elementaryView.frame = (CGRect){{0,0},image.size};
    self.elementaryView.center = (CGPoint){160,140};
    self.elementaryView.backgroundColor = [UIColor colorWithPatternImage:image];
    
    image = [[UIImage imageNamed:@"Oval_level5"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.beginningView.frame = (CGRect){{0,0},image.size};
    self.beginningView.center = (CGPoint){160,140};
    self.beginningView.backgroundColor = [UIColor colorWithPatternImage:image];
}
@end
